<%@ page language="java" import="com.alibaba.fastjson.JSONObject" pageEncoding="UTF-8" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%--获取流水号--%>
<%
    RecordSet rs = new RecordSet();
    JSONObject jsonData = new JSONObject();
    String ids = Util.null2String( request.getParameter( "ids" ) );
    String sql = ";with cte as (\n" +
            "  select id,lb,sjlb from view_custom_wzlb where id='"+ids+"'\n" +
            "  union all \n" +
            "  select a.id,a.lb,a.sjlb from view_custom_wzlb a join cte c on a.id=c.sjlb\n" +
            ")\n" +
            "\n" +
            "select id,lb from cte where sjlb is null";
    rs.executeQuery( sql );
    rs.next();
    String id = Util.null2String( rs.getString( 1 ) );
    jsonData.put( "id", id );
    out.print( jsonData.toJSONString() );

%>
